Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: abbrev produces theorems where appropriate #6083

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

kim-em
Copy link
Collaborator

@kim-em kim-em commented Nov 14, 2024

This PR modifies the abbrev keyword, ensuring that it produces a theorem when the declaration is a Prop. This is convenient for the frequent current use case of abbrev to set up deprecations.

@github-actions github-actions bot added changes-stage0 Contains stage0 changes, merge manually using rebase toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN labels Nov 14, 2024
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Nov 14, 2024

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase e0d7c3ac79bd9167ce7d295f51bf3779a04f7a07 --onto 9a8543347796e52070ff7936661ae48fcebfea60. (2024-11-14 23:35:49)
  • ✅ Mathlib branch lean-pr-testing-6083 has successfully built against this PR. (2024-11-21 08:55:45) View Log
  • ✅ Mathlib branch lean-pr-testing-6083 has successfully built against this PR. (2024-11-26 07:13:12) View Log
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 827062f807cd869709fb71d5d04a00ff10320be3 --onto 6d495586a1836da3e12efb4fbf9946bd9088ac5f. (2024-11-29 01:12:55)

@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc November 14, 2024 23:37 Inactive
@eric-wieser
Copy link
Contributor

Is there any advantage of using abbrev over theorem in this case?

@kim-em
Copy link
Collaborator Author

kim-em commented Nov 17, 2024

Is there any advantage of using abbrev over theorem in this case?

Yes, we can use abbrev X := @Y, to avoid having the type out the signature, when deprecating. In Batteries and below, we have alias, but I don't think alias is ready to move upstream (precisely because it results in us having too many ways to do the same thing: eventually I would like a unification of abbrev and alias functionality into a single keyword).

@kim-em kim-em force-pushed the abbrev_thm branch 2 times, most recently from a4b2b68 to 1431cba Compare November 21, 2024 07:48
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Nov 21, 2024
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc November 21, 2024 08:13 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 21, 2024
@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Nov 21, 2024
@kim-em kim-em added the awaiting-review Waiting for someone to review the PR label Nov 26, 2024
@kim-em
Copy link
Collaborator Author

kim-em commented Nov 26, 2024

I'm adding the awaiting-review tag as I would like another set of eyes on this before merging. It feels a bit hacky to me still. :-(

This is an intermediate measure until we decide on a unification of alias / abbrev etc.

@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc November 26, 2024 06:30 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Nov 26, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 26, 2024
@kim-em kim-em marked this pull request as ready for review November 26, 2024 06:44
@kim-em kim-em added the changelog-language Language features, tactics, and metaprograms label Nov 26, 2024
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc November 29, 2024 01:11 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review Waiting for someone to review the PR builds-mathlib CI has verified that Mathlib builds against this PR changelog-language Language features, tactics, and metaprograms changes-stage0 Contains stage0 changes, merge manually using rebase toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants